<%@ page contentType="text/html;charset=UTF-8" %>
<%@ include file="/WEB-INF/views/include/taglib.jsp"%>
<html>
<head>
	<title>物流用户管理</title>
	<meta name="decorator" content="default"/>
	<script type="text/javascript">
		$(document).ready(function() {
		});
	</script>
</head>
<body class="gray-bg">
	<div class="wrapper wrapper-content">
	<div class="ibox">
	<div class="ibox-title">

		<c:if test="${logisUser.type eq '3'}">
			<h5>合伙人列表 </h5>
		</c:if>
		<c:if test="${logisUser.type ne '3'}">
			<h5>用户列表 </h5>
		</c:if>
	</div>
    <div class="ibox-content">
	<sys:message content="${message}"/>
	
	<!--查询条件-->
	<div class="row">
	<div class="col-sm-12">
	<form:form id="searchForm" modelAttribute="logisUser" action="${ctx}/logis/logisUser/" method="post" class="form-inline">
		<input id="pageNo" name="pageNo" type="hidden" value="${page.pageNo}"/>
		<input id="pageSize" name="pageSize" type="hidden" value="${page.pageSize}"/>
		<table:sortColumn id="orderBy" name="orderBy" value="${page.orderBy}" callback="sortOrRefresh();"/><!-- 支持排序 -->
		<div class="form-group">
			<span>昵称：</span>
				<form:input path="nickName" htmlEscape="false" maxlength="32"  class=" form-control input-sm"/>
			<span>手机号：</span>
				<form:input path="mobile" htmlEscape="false" maxlength="12"  class=" form-control input-sm"/>
			<span>小程序：</span>
			<form:select path="appId"  class="form-control m-b">
				<form:option value="" label=""/>
				<form:options items="${fns:getDictList('logis_appId')}" itemLabel="label" itemValue="value" htmlEscape="false"/>
			</form:select>
			<div class="pull-right">
				<button  class="btn btn-primary btn-sm " onclick="search()" ><i class="fa fa-search"></i> 查询</button>
			</div>
		 </div>	
	</form:form>
	<br/>
	</div>
	</div>
	

	
	<!-- 表格 -->
	<table id="contentTable" class="table table-striped table-bordered table-hover table-condensed dataTables-example dataTable">
		<thead>
			<tr>
				<th  class="sort-column headImg">头像</th>
				<th  class="sort-column nickName">昵称</th>
				<th  class="sort-column mobile">手机号</th>
				<th  class="sort-column balance">余额</th>
				<th  class="sort-column scoreTotal">积分</th>
				<c:if test="${logisUser.type eq '3'}">
					<th  class="sort-column scoreTotal">车队</th>
				</c:if>
				<c:if test="${logisUser.type ne '3'}">
					<th  class="sort-column scoreTotal">好友</th>
					<th  class="sort-column jiaocheNum">下单次数</th>
					<th  class="sort-column shouhuoNum">收货次数</th>
				</c:if>

				<th  class="sort-column appId">小程序</th>
				<th  class="sort-column friendNum">用户权限</th>
				<th   width="10%" class="sort-column registTime">注册时间</th>
				<th width="10%">操作</th>
			</tr>
		</thead>
		<tbody>
		<c:forEach items="${page.list}" var="logisUser">
			<tr>

				<td>
						<img src="${logisUser.headImg}" width="60px">
				</td>
				<td>
					${logisUser.nickName}
				</td>
				<td>
					${logisUser.mobile}
				</td>

				<td>
					${logisUser.balance}
					      <c:if test="${not empty logisUser.balance && logisUser.balance>0}">
							<a onclick="openDialogView('收入记录', '${ctx}/logis/logisUser/viewRechargeLogs?unionId=${logisUser.unionId}','480px', '520px')"  >收入记录</a>
						  </c:if>
				</td>
				<td>
						${logisUser.scoreTotal}
				</td>

				<c:if test="${logisUser.type eq '3'}">
					<td>
							${logisUser.fleetNum}
					</td>
				</c:if>
				<c:if test="${logisUser.type ne '3'}">
					<td>
							${logisUser.friendNum}
					</td>
					<td>
						${logisUser.jiaocheNum}
				</td>
				<td>
						${logisUser.shouhuoNum}
				</td>
				</c:if>
				<td>
						${fns:getDictLabel(logisUser.appId, 'logis_appId', '')}
				</td>
				<td>
					<c:if test="${logisUser.status eq '0' }"><span class="text-danger">黑名单</span>
					</c:if>
					<c:if test="${logisUser.status eq '1' }"><span class="text-warning">白名单</span>
					</c:if>
				</td>
				<td>
					<fmt:formatDate value="${logisUser.registTime}" pattern="yyyy-MM-dd HH:mm:ss"/>
				</td>
				<td>
					<shiro:hasPermission name="logis:logisUser:view">
						<a href="#" onclick="openDialog('查看与修改用户信息', '${ctx}/logis/logisUser/form?id=${logisUser.id}','800px', '500px')" class="btn btn-info btn-xs" > 查看与修改</a>
					</shiro:hasPermission>
					<c:if test="${logisUser.status eq '0' }">
						<a href="${ctx}/logis/logisUser/updateStatus?id=${logisUser.id}&status=1" onclick="return confirmx('确认设置白名单状态吗？', this.href)"  class="btn btn-warning btn-xs" >设置白名单</a>
					</c:if>
					<c:if test="${logisUser.status eq '1' }">
						<a href="${ctx}/logis/logisUser/updateStatus?id=${logisUser.id}&status=0" onclick="return confirmx('确认设置成黑名单状态吗？', this.href)"  class="btn btn-danger btn-xs" >设置黑名单</a>
					</c:if>

				</td>
			</tr>
		</c:forEach>
		</tbody>
	</table>
	
		<!-- 分页代码 -->
	<table:page page="${page}"></table:page>
	<br/>
	<br/>
	</div>
	</div>
</div>
</body>
</html>